package com.test.qpbgboot.base.exception;

import com.test.qpbgboot.base.response.ResultStatus;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public class ServiceException extends RuntimeException {
    private Integer code;
    private String msg;
    private String detail;

//    private ResultStatus status;

    public ServiceException(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ServiceException(ResultStatus resultStatus) {
        this.code = resultStatus.getCode();
        this.msg = resultStatus.getMsg();
    }

    public ServiceException(ResultStatus resultStatus, String detail) {
        this(resultStatus);
        this.detail = detail;
    }

}
